Skip to content

feat: Add comprehensive Bridge integration tests#21

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1758631957-bridge-integration-tests
Open

feat: Add comprehensive Bridge integration tests#21
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1758631957-bridge-integration-tests

Conversation

@devin-ai-integration
Copy link
Copy Markdown

feat: Add comprehensive Bridge integration tests

Summary

Added comprehensive integration tests for the Bridge quote fetching system covering cross-chain transaction flows, quote validation, timeout handling, and error scenarios with external bridge providers. The test suite includes:

  • BridgeCrossChainFlow.integration.test.tsx - Tests complete user flows for EVM-to-EVM, EVM-to-Solana, and Solana-to-EVM bridge transactions
  • BridgeQuoteValidation.integration.test.tsx - Tests quote parameter validation and multiple bridge provider response handling
  • BridgeTimeoutHandling.integration.test.tsx - Tests quote expiration, refresh cycles, and network timeout scenarios
  • BridgeProviderErrors.integration.test.tsx - Tests various external provider error scenarios (rate limiting, service unavailability, network issues)
  • Enhanced testUtils/index.ts - Added helper functions for creating mock quote responses, error states, and timeout scenarios

The tests simulate real user workflows from token selection through quote fetching to transaction submission, with comprehensive error handling and edge case coverage.

Review & Testing Checklist for Human

⚠️ 4 critical items to verify due to testing environment concerns:

  • Test Execution in CI: Verify all integration tests run successfully in CI without hanging (I encountered Jest hanging issues during coverage collection due to a TypeScript declaration error)
  • Mock Accuracy: Review the extensive mocking of Engine, BridgeController, and external dependencies to ensure they accurately represent real system behavior
  • Test Performance: Check that the test suite runs efficiently and doesn't significantly slow down CI (these are complex integration tests with heavy mocking)
  • Real Integration Value: Validate that these tests provide meaningful coverage beyond existing unit tests, considering they primarily test UI behavior with mocked external provider responses rather than actual network integration

Test Plan

  1. Run yarn jest app/components/UI/Bridge/tests-integration/ to execute the new integration test suite
  2. Verify all existing Bridge tests still pass: yarn jest app/components/UI/Bridge/
  3. Check TypeScript compilation: yarn lint:tsc
  4. Test a few cross-chain quote fetching flows manually in the app to ensure the test scenarios reflect real user behavior

Notes

  • Tests had to be moved from integration-tests/ to tests-integration/ directory due to Jest module resolution issues
  • Coverage collection hangs due to an unrelated TypeScript declaration error in app/declarations/index.d.ts (captureException export issue)
  • Tests focus on UI behavior and component integration rather than actual external API calls, which are mocked
  • Link to Devin run: https://app.devin.ai/sessions/b5e24e3577354ffe99dca03c576926c8
  • Requested by @mbatchelor81

- Add BridgeCrossChainFlow.integration.test.tsx for cross-chain transaction flows (EVM-to-EVM, EVM-to-Solana, Solana-to-EVM)
- Add BridgeQuoteValidation.integration.test.tsx for quote validation and external provider integration
- Add BridgeTimeoutHandling.integration.test.tsx for timeout handling and quote expiration scenarios
- Add BridgeProviderErrors.integration.test.tsx for external bridge provider error scenarios
- Enhance testUtils/index.ts with additional mock utilities for integration testing
- Cover comprehensive user workflows from token selection through quote fetching to transaction submission
- Include error handling for rate limiting, service unavailability, network issues, and provider maintenance
- Test quote expiration, refresh cycles, and timeout recovery mechanisms

Co-Authored-By: mason.batchelor@windsurf.com <mason.batchelor@windsurf.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants